#include<bits/stdc++.h>
using namespace std;
const int N=15;
long long n,p,a[N],b[N],h[N],ans;
void dfs(int i,long long z,long long sum)
{
	if(i==n+1)
	{
		ans=min(ans,sum);
		return;
	}
	for(int j=1;j<=n;++j)
		if(!b[j])
			b[j]=1,dfs(i+1,max(z,a[j]),sum+(h[j]-1)/z*a[j]),b[j]=0;
}
int main()
{
	freopen("xinyue.in","r",stdin); 
	freopen("xinyue.out","w",stdout); 
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	cin>>n>>p;
	ans=1e18;
	for(int i=1;i<=n;++i)
		cin>>a[i]>>h[i];
	dfs(1,p,0);
	cout<<ans;
	return 0;
 } 
